# MorseSender

MorseSender sends a morse encoded message via a simple mosfet circuit to a
ledstrip. The circuit is driven by the D6-pin of an ESP8266 board. The
board must be running the StandardFirmataWiFi.ino sketch.

# Steps to get it working

1. Install a recent version of the Arduino IDE.
1. Get the Arduino software for the ESP8266 board:
   https://github.com/esp8266/Arduino#installing-with-boards-manager
   (my board works as 'NodeMCU 1.0' and with highest upload speed)
1. Install the Arduino Firmata library.
1. Create an arduino sketch with a copy of StandardFirmataWiFi.ino and
   wifiConfig.h from examples in the Firmata library.
1. Edit wifiConfig.h for your wifi credentials. Optionally uncomment the
   SERIAL_DEBUG line in StandardFirmataWiFi.ino.
1. Upload StandardFirmataWiFi to your board using the Arduino IDE. If you get a
   compilation error: I got one too. I needed to edit Firmata.h from the
   Arduino Firmata library. My working version is in contrib/.
1. Assemble the circuit: see below.
1. Turn on the board. The blue led indicates it successfully connected to the
   WiFi network. Find out its IP-address. If you turned on SERIAL_DEBUG above,
   it shows on the serial port (in my case the default speed was 9600).
1. Edit config.py so it holds the IP-address, the message you want to send and
   what else you need to change.

# The Circuit

<img src="https://notabug.org/mouz/vario/raw/master/arduino/morsesender/circuit.jpg" alt="circuit" width="301" height="165" />
<br />
<img src="https://notabug.org/mouz/vario/raw/master/arduino/morsesender/connections.jpg" alt="connections" width="135" height="177" />
<br />

# Test
```
pytest -v .
```
If the test fails somehow and you can't seem to fix it, contact me: I'll be
happy to help you out.

# Run
This should signal your message in morse on the ledstrip:
```
python3 morsesender.py
```

